package pixelwaks.core.impl;

import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import common.util.FileHandler;

import pixelwaks.core.IAnimation;

public class Explosion implements IAnimation {

	private List<BufferedImage> images;
	private int CURRENT_IMAGE;
	private Point position;
	private boolean active;
	
	public Explosion() {
		
		active = false;		
		images = new ArrayList<BufferedImage>();
		
		for(int i = 1; i < 7; i++)
			try {
				images.add(FileHandler.getImage(FileHandler.ANIMATION, "explosion0" + i + ".png"));
			} catch (IOException e) {
				e.printStackTrace();
			}
	}
	
	@Override
	public BufferedImage getCurrentImage() {
		
		return images.get(CURRENT_IMAGE);
	}
	
	public void setCurrentImage(int i) {
		
		CURRENT_IMAGE = i;
	}
	
	public int getAnimationSize() {
		
		return images.size();
	}
	
	@Override
	public Point getPosition() {
		
		return position;
	}
	
	public void setPosition(Point p) {
		
		position = p;
	}
	
	@Override
	public boolean isActive() {
		
		return active;
	}
	
	public void setActive(boolean active) {
		
		this.active = active;
	}
}
